package constructor11;

public abstract class Employee {
    private String id;
    private String name;

    private boolean marrystatus;

    public abstract void work();
    public boolean isMarrystatus() {
        return marrystatus;
    }
    //bool类型的方法不用getxxx,而是isxxxx
    public void setMarrystatus(boolean marrystatus) {
        this.marrystatus = marrystatus;
    }

    public Employee(String id,String name,boolean marrystatus){
        this.id = id;
        this.name = name;
        this.marrystatus = marrystatus;
    }

    public Employee(String id,String name){
        this(id,name,false);
    }



    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
